#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QThread>
#include <QTimer>
#include <QEventLoop>
#include <QMediaPlayer>
#include "easyinput.h"
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class camera;
class BaiduLPR;
class carsql;
class serialport;
class downfile;
class TTS;
class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    int row;
private:
    Ui::MainWindow *ui;

    QMediaPlayer *play;

    downfile *carIDTTS;
    TTS *tts;
    /* 数据库更新定时器 */
    QTimer *sqltimer;

    /* 串口 */
    serialport *MyCom;

    /* 摄像头指针 */
    camera *Camera;

    /* 摄像头线程 */
    QThread CameraThread;

    /* OCR */
    BaiduLPR *Ocr;

    QThread OcrThread;
    QThread downfileThread;
    QThread TTSThread;
    /* CarSql */
    carsql *mysql;

signals:
    void GetLicensePlateFlag();
    void saveImgFlag(int);
    void OCRFlag(QString);
    void MaskFlag(QString);
    void downfileUrl(QString);
    void sqltest();
    void sqlchaxuntest(QString);
    void CCTVON(bool);
    void closeCamera();
private slots:
    /* 显示图片 */
    void showImage(const QImage&);
    /* 打开摄像头处理函数 */
    void sqlshow();
    void on_pushButton_16_clicked();
    void on_pushButton_17_clicked();
    void on_pushButton_6_clicked();
    void on_database_show_clicked(const QModelIndex &index);
    void on_pushButton_7_clicked();
    void on_pushButton_8_clicked();
    void on_pushButton_18_clicked();
    void on_pushButton_9_clicked();
    void on_pushButton_clicked(bool);
    void on_pushButton_2_clicked();
    void on_pushButton_3_clicked();
    void on_pushButton_4_clicked();
    void on_pushButton_5_clicked();
};
#endif // MAINWINDOW_H
